package com.bwda.dsrs.base.centerbase.condition;

/**
 * @author yangjun
 * @date 2019/4/18
 */
public abstract class BaseCondition {
    private int pageSize = 20;
    private int pageNum = 0;
    private int skipResults = 0;
    private String orderBy;

    public BaseCondition() {
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
        this.skipResults = pageSize * this.pageNum;
    }

    public void setPageNum(int pageNo) {
        this.pageNum = pageNo;
        this.skipResults = this.pageSize * pageNo;
    }

    @Override
    public String toString() {
        return "BaseCondition(pageSize=" + this.getPageSize() + ", pageNum=" + this.getPageNum() + ", skipResults=" + this.getSkipResults() + ", orderBy=" + this.getOrderBy() + ")";
    }

    public int getPageSize() {
        return this.pageSize;
    }

    public int getPageNum() {
        return this.pageNum;
    }

    public int getSkipResults() {
        return this.skipResults;
    }

    public String getOrderBy() {
        return this.orderBy;
    }

    public void setOrderBy(String orderBy) {
        this.orderBy = orderBy;
    }
}
